import Ember from 'ember';
export default Ember.Controller.extend({
    constants: Constants,
    //queryCondition:'',
    mainController: Ember.inject.controller('business.mainpage'),
    dateService: Ember.inject.service("date-service"),
    actions: {
        dpShowAction(e) {
        },
        toDetailPage(warning) {
            //alert("1111");
            //console.log("+++++++warning+++++++++",warning);
            if (warning) {
                let id = warning.get('id');
                console.log("++++++++id++++++++++++++++**********", id);
                this.get("mainController").switchMainPage('warning-detail', {
                    id: id,
                    editMode: "edit"
                });
            } else {
                //alert("添加");
                console.log("+++++++warning+++++++++", warning);
                this.get("mainController").switchMainPage('warning-detail', {
                    editMode: "add",
                    id: ""
                });
            }
        },
        changeBeginDateAction(date) {
            //var stamp = this.get("dateService").getLastSecondStampOfDay(date);
            //this.set("warningModel.callTime", stamp);
            //var stamp=this.get("dateService").dateFormat(date,"yyyy-MM-dd");
            this.set("beginDate", date);
        },
        changeEndDateAction(date) {
            //var stamp=this.get("dateService").dateFormat(date,"yyyy-MM-dd");
            console.log("is true", typeof date);
            this.set("endDate", date);
        },
    }
});
